package org.tvolkov.mycompany

import static org.junit.Assert.*
import org.junit.*

class IntegrationTests {
	static transactional = true
    @Before
    void setUp() {
        // Setup logic here
    }

    @After
    void tearDown() {
        // Tear down logic here
    }

    @Test
    void testSomething() {
		def cmp1 = new Company(name: "company1").save();
		def div1 = new Division(name: "division", company: cmp1).save();
		def prj1 = new Project(name: "project1", customer: "c1", deadline: new Date(), division: div1).save();
		def empl1 = new Employee(name: "empl1", project: prj1).save();
		def empl2 = new Employee(name: "empl2", project: prj1).save();
		
//		assertEquals 1, Company.list().size();
		assertEquals 1, Division.list().size();
		assertEquals 1, Project.list().size();
		assertEquals 2, Employee.list().size();
	}
}
